package com.qtu.product_service.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qtu.entity.BmCategory;
import com.qtu.product_service.entity.ReCaregory;
import com.qtu.product_service.mapper.CategoryMapper;
import com.qtu.product_service.service.CategoryService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, BmCategory> implements CategoryService {
    @Resource
    private CategoryMapper categoryMapper;
    private Map<String ,Object>map=new  HashMap<>();

    /**
     * 查询一级菜单
     * @return
     */
    @Override
    public List<ReCaregory> selectMenus() {
        List<ReCaregory> list = categoryMapper.selectMenus();
        return list;
    }

    /**
     * 按条件查询商品
     * @param reCaregory
     * @return
     */
    @Override
    public Map<String, Object> selectAll(ReCaregory reCaregory) {
        List<ReCaregory> list = categoryMapper.selectAll(reCaregory);
        map.put("all",list);
        return map;
    }
}

